//----------------------------------------------------------------------------------------------
//	Filename:	Interval.cpp
//	Author:		Keith Bugeja
//	Date:		27/02/2010
//----------------------------------------------------------------------------------------------
//----------------------------------------------------------------------------------------------
#include <boost/format.hpp>
#include "Geometry/Interval.h"

using namespace Illumina::Core;
//----------------------------------------------------------------------------------------------
Interval::Interval(void) 
	: Min(0.0f)
	, Max(0.0f)
{ }
//----------------------------------------------------------------------------------------------
Interval::Interval(float p_fValue) 
	: Min(p_fValue)
	, Max(p_fValue) 
{ }
//----------------------------------------------------------------------------------------------
Interval::Interval(float p_fMin, float p_fMax) 
	: Min(p_fMin)
	, Max(p_fMax) 
{ }
//----------------------------------------------------------------------------------------------
Interval::Interval(const Interval& p_interval) 
	: Min(p_interval.Min)
	, Max(p_interval.Max) 
{ }
//----------------------------------------------------------------------------------------------
float Interval::operator[](int p_nIndex) const { 
	return Element[p_nIndex]; 
}
//----------------------------------------------------------------------------------------------
float& Interval::operator[](int p_nIndex) { 
	return Element[p_nIndex]; 
}
//----------------------------------------------------------------------------------------------
std::string Interval::ToString(void) const
{
	std::string strOut = boost::str(boost::format("[%d %d]") % Min % Max);
	return strOut;
}
//----------------------------------------------------------------------------------------------
